package com.pacy.swj.swjwb.adapters;

import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.pacy.swj.swjwb.R;
import com.pacy.swj.swjwb.Utils.ColorUtils;
import com.pacy.swj.swjwb.Utils.Constans;
import com.pacy.swj.swjwb.beans.QureyMapBean;

import h.framework.android.utils.ImageUtil;
import h.framework.android.utils.LogUtil;

/**
 * @author PACY
 * 创建时间 19/6/14 14:03.
 * 邮箱 pengwwe457621023@qq.com
 * 类描述
 */
public class MainAdapter extends BaseQuickAdapter<QureyMapBean, BaseViewHolder> {
    public MainAdapter() {
        super(R.layout.main_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, QureyMapBean item) {
        LinearLayout item_bg_lin = helper.getView(R.id.item_bg_lin);
        ColorUtils.setBackgroundColor(item_bg_lin, helper.getAdapterPosition());
        helper.setText(R.id.name_tv, item.getMenuName());


        ImageUtil.loadImage(Constans.BASE_IMAGE_URL+item.getMenuIcon(), (ImageView) helper.getView(R.id.icon_iv));

        LogUtil.i("图片地址-----"+ Constans.BASE_IMAGE_URL+item.getMenuIcon());

    }
}
